package org.redis.cluster.extension;

import java.util.Collection;

import org.redis.cluster.RedisCluster;

public class DefaultExtensionLoader implements ExtensionLoader {
	
	private ExtensionLoader extensionLoader;
	
	public DefaultExtensionLoader(RedisCluster redisCluster) {
		SimpleExtensionLoader simpleExtensionLoader=new SimpleExtensionLoader();
		PluginExtensionLoader pluginExtensionLoader=new PluginExtensionLoader(redisCluster, simpleExtensionLoader);
		this.extensionLoader=pluginExtensionLoader;
	}
	
	@Override
	public <T> Collection<T> load(Class<T> type) {
		return extensionLoader.load(type);
	}

	@Override
	public <T> T load(Class<T> type, Object... parameters) {
		return extensionLoader.load(type, parameters);
	}

	@Override
	public <T> T load(String name, Class<T> type, Object... parameters) {
		return extensionLoader.load(name, type, parameters);
	}

	@Override
	public void init() {
		extensionLoader.init();
	}

	@Override
	public void destroy() {
		extensionLoader.destroy();
	}

}